import React, { Component } from 'react';
import {StyleSheet, TouchableOpacity,View, Text,Image  } from 'react-native';
import Screen from '../../common/screen'
import ImageResources from '../../common/ImageResources'
import moment from 'moment'

class TicketingItem extends Component {
  constructor(props) {
    super(props)
    this.state = {
      headImgError: false
    }
  }

  // handleImageErrored() {//酒店图片错误时执行此方法
  //   this.setState({ headImgError: true })
  // }

  render(){
    let {singlePrice, leftNum,orderTime,checkTime, totalPrice,num,consumptionName,ticketSource,state,ticketName}=this.props
			
    let { headImgError } = this.state
    return(
      <View style={styles.container}>
        <View style={{flexDirection:'row',flex:1}}>
            <Text style={{fontSize:18,flex:1,textAlign:'left',fontWeight:'500'}}>{consumptionName}x{num}</Text>
            <Text style={{fontSize:18,flex:1,textAlign:'right',fontWeight:'500'}}>￥{totalPrice}</Text>
        </View>
        <View style={{flexDirection:'row',flex:1,marginTop:5}}>
            <Text style={{fontSize:12,flex:1,textAlign:'left'}}>{ticketName}</Text>
        </View>
        <View style={{flexDirection:'row',flex:1}}>
            <Text style={{fontSize:12,flex:1,textAlign:'left'}}>{orderTime}</Text>
            <Text style={{fontSize:12,flex:1,textAlign:'right',fontWeight:'500',color:'#ccc'}}>{state}</Text>
        </View>
  
      </View>
    )
  }
}
const styles = StyleSheet.create({
  container:{
    width: Screen.width*0.90,
    marginLeft:Screen.width*0.05,
    flexDirection: 'column',
    alignItems: 'center',
    height:84,
    paddingVertical:8,
    paddingHorizontal: 15,
    backgroundColor: 'white',
    borderColor: '#ddd',
    borderWidth: 0.5,
    marginVertical:6,
    borderRadius:5,
    justifyContent: 'center',
  },

})
export default TicketingItem;
